{*include file="template/admin_head.htm"*}

<table id="containtable" cellspacing="0" cellpadding="0" class="{*$cf_controller*}">
    <tr>
        <td width="1979" valign="top" bgcolor="#FFFFFF">
		 <div class="wrapper pr_8">
		{*if $cf_action=='add' || $cf_action=='edit'*}
        <link rel="stylesheet" href="/public/js/tageditor/jquery.tag-editor.css">
		<script src="/public/js/tageditor/jquery.tag-editor.js"></script>
        <script type="text/javascript">
			 $(function(){	
				
				$("#act_form").submit(function(){
					if($("#brand_name").val() == ''){
						my_alert('请输入标题','错误提示',"$('#brand_name').focus()");
						return false;										
					}	
					if($("#brand_description").val() == ''){
						my_alert('请输入简要描述','错误提示',"$('#brand_description').focus()");
						return false;										
					}	
					if($("#brand_content").val() == ''){
						my_alert('请输入品牌故事','错误提示',"$('#brand_content').focus()");
						return false;										
					}
					if($("#brand_address").val() == ''){
						my_alert('请输入发货地址','错误提示',"$('#brand_address').focus()");
						return false;										
					}
					if($("#brand_logo").val() == ''){
						my_alert('请上传品牌LOGO','错误提示',"$('#brand_logo').focus()");
						return false;										
					}
					if($("#brand_image_path").val() == ''){
						my_alert('请上传封面图','错误提示',"$('#brand_image_path').focus()");
						return false;										
					}					
				});
				
				call_uploader('#brand_image_path_button','#brand_image_path','brand',{'show':'#brand_image_path_show'});
				{*if $row['brand_image_path']*}
				$("#brand_image_path_show").append(show_photo_div("#brand_image_path_button","#brand_image_path","{*$row['brand_image_path']*}","admin",false));
				{*/if*}
				
				call_uploader('#brand_logo_button','#brand_logo','brand',{'show':'#brand_logo_show'});
				{*if $row['brand_logo']*}
				$("#brand_logo_show").append(show_photo_div("#brand_logo_button","#brand_logo","{*$row['brand_logo']*}","admin",false));
				{*/if*}
				
				call_uploader('#brand_banner_image_button','#brand_banner_image','brand',{'show':'#brand_banner_image_show'});
				{*if $row['brand_banner_image']*}
				$("#brand_banner_image_show").append(show_photo_div("#brand_banner_image_button","#brand_banner_image","{*$row['brand_banner_image']*}","admin",false));
				{*/if*}
				
								
				call_editor('#brand_content','full');
				$('#brand_tags').tagEditor({ initialTags: [{*$row['brand_tags']*}], placeholder: '请输入标签' });

		    });
			</script>
        
    

                <div class="content_panel_title">
                    <div class="contentpanelleft"></div>
                    <div class="contentpanelcenter">
                        <span class="contentpanelcenter_font">新增/修改商品分类</span>
                        <span><a class="edit at" href="{*$cf_self_page*}?dpt={*$cf_dpt*}">商品分类管理</a></span></div>
                    <div class="contentpanelrihgt"></div>
                </div>
                <div class="content_table_center_style">
                    <div class="p8">

                        <form name="act_form" id="act_form" method="post" action="{*$cf_self_page*}">
                            <input name="id" id="id" type="hidden" value="{*$row['brand_id']*}" />
                            <input name="dpt" id="dpt" type="hidden" value="{*$cf_dpt*}" />
                            <input name="act" id="act" type="hidden" value="{*$cf_action*}" />				
				<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tbl tbl_nbr">
				<tbody>	
                	<tr>
					<td width="12%" align="right">序号:</td>
					<td colspan="3" align="left"><input type="text" size="6" id="brand_sort_num" name="brand_sort_num" value="{*$row['brand_sort_num']*}" /> <span class="red">0是最前</span></td>
				    </tr>	                				
				    <tr>
					<td width="12%" align="right">标题:</td>
					<td colspan="3" align="left"><input type="text" size="30" id="brand_name" name="brand_name" value="{*$row['brand_name']*}" /></td>
				    </tr>
                     <tr>
					 	<td align="right">标签:</td>
					 	<td colspan="3" align="left"><input type="text" id="brand_tags" name="brand_tags"/></td>
				 	</tr>
                    <tr>
					<td width="12%" align="right">分类:</td>
					<td colspan="3" align="left">{*html_options name=brand_cate_id options=$brand_cate selected=$row['brand_cate_id']|default:''*}</td>
				    </tr>						
					<tr>
					<td align="right">简要描述:</td>
					<td colspan="3" align="left"><textarea name="brand_description" id="brand_description" cols="100" rows="4">{*$row.brand_description*}</textarea></td>
					</tr>                    
				    <tr>
					<td align="right">品牌故事:</td>
					<td colspan="3" align="left">
					    <textarea name="brand_content" id="brand_content" style="width:800px;height:500px;">{*$row.brand_content*}</textarea></td>
				    </tr>
                    <tr>
					<td width="12%" align="right">发货地址:</td>
					<td colspan="3" align="left"><input type="text" size="60" id="brand_address" name="brand_address" value="{*$row['brand_address']*}" /></td>
				    </tr>
                    <tr>
						<td align="right">品牌LOGO:</td>
						<td colspan="3" ><span id='brand_logo_show'><img style="cursor:pointer" id="brand_logo_button" src="/public/images/admin/upload.jpg" /></span>
							<input type="hidden" name="brand_logo" id="brand_logo" value="{*$row['brand_logo']*}" /></td>						
					</tr>
                    <tr>
						<td align="right">封面图片:</td>
						<td colspan="3" ><span id='brand_image_path_show'><img style="cursor:pointer" id="brand_image_path_button" src="/public/images/admin/upload.jpg" /></span>
							<input type="hidden" name="brand_image_path" id="brand_image_path" value="{*$row['brand_image_path']*}" /></td>						
					</tr>
                    <tr>
						<td align="right">首页轮播图片:</td>
						<td colspan="3" ><span id='brand_banner_image_show'><img style="cursor:pointer" id="brand_banner_image_button" src="/public/images/admin/upload.jpg" /></span>
							<input type="hidden" name="brand_banner_image" id="brand_banner_image" value="{*$row['brand_banner_image']*}" /></td>						
					</tr>  
                 
                    <tr>
					<td align="right">是否显示:</td>
					<td colspan="3" align="left">{*html_radios name=brand_is_show options=$cf_info_var_common['yesno'] checked=$row['brand_is_show']|default:'1'*}</td>
				    </tr>
                    <tr>
					<td align="right">是否推荐到首页:</td>
					<td colspan="3" align="left">{*html_radios name=brand_is_index options=$cf_info_var_common['yesno'] checked=$row['brand_is_index']|default:'0'*}</td>
				    </tr>
                    <tr>
					<td width="12%" align="right">作者:{*$cf_admin_info['user_name']*}</td>
					<td colspan="3" align="left"><input type="text" size="60" id="brand_author" name="brand_author" value="{*$row['brand_author']|default:{*$cf_admin_info['admin_name']*}*}" /></td>
				    </tr>           

				</tbody>
			    </table>				
				
				<div class="pt_8" align="center"><input type="submit" name="Submit" value="提 交" class="myinput" />
                 &nbsp;&nbsp;<input type="button" name="back" value="返 回" onclick="window.history.back()" class="myinput" /></div>
                     </form>
                     
                    </div>
                </div>
                <div class="content_main_bottom">
                    <div class="content_main_bottom_left"></div>
                    <div class="content_main_bottom_right"></div>
                </div>

            {*elseif $cf_action=='detail'*}
            	<div class="content_panel_title">
                    <div class="contentpanelleft"></div>
                    <div class="contentpanelcenter">
                        <span class="contentpanelcenter_font">新增/修改品牌</span>
                        <span><a class="edit at" href="{*$cf_self_page*}?dpt={*$cf_dpt*}">品牌管理</a></span></div>
                    <div class="contentpanelrihgt"></div>
                </div>
                <div class="content_table_center_style">
                    <div class="p8"> 
                                           			
					<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tbl tbl_nbr">
					<tbody>	
                	 <tr>
					<td width="173" align="right">序号:</td>
					<td width="981" colspan="3" align="left">{*$row['brand_sort_num']*} <span class="red">0是最前</span></td>
				    </tr>				
				    <tr>
					<td width="173" align="right">标题:</td>
					<td colspan="3" align="left">{*$row['brand_name']*}</td>
				    </tr>					
					<tr>
					<td align="right">简要描述:</td>
					<td colspan="3" align="left">{*$row['brand_description']*}</td>
					</tr>                    
				    <tr>
					<td align="right">品牌故事:</td>
					<td colspan="3" align="left" width="981">{*$row['brand_content']*}</td>
				    </tr>
                    <tr>
					<td width="173" align="right">发货地址:</td>
					<td colspan="3" align="left">{*$row['brand_address']*}</td>
				    </tr>
                    <tr>
						<td align="right">品牌LOGO:</td>
						<td colspan="3" ><img src="{*$row['brand_logo']*}" /></td>
						
					</tr> 
                    
                    
                     <tr>
						<td align="right">封面图片:</td>
						<td colspan="3" ><img src="{*$row['brand_image_path']*}" /></td>
						
					</tr> 
                 
                    <tr>
					<td align="right">是否显示:</td>
					<td colspan="3" align="left">{*$cf_info_var_common['yesno'][$row['brand_is_show']]*}</td>
				    </tr>
                    <tr>
					<td width="173" align="right">访问总数:</td>
					<td colspan="3" align="left">{*$row['brand_total_visits']*}</td>
				    </tr> 
                    <tr>
					<td width="173" align="right">作者:</td>
					<td colspan="3" align="left">{*$row['brand_author']*}</td>
				    </tr> 
                    <tr>
					<td width="173" align="right">创建时间:</td>
					<td colspan="3" align="left">{*$row['brand_create_time']*}</td>
				    </tr>
                                

				</tbody>
			    </table>				
				
                     
                    </div>
                </div>
                <div class="content_main_bottom">
                    <div class="content_main_bottom_left"></div>
                    <div class="content_main_bottom_right"></div>
                </div>
            


		    {*else*}
		    
		    <div class="pannel">
			<div class="pl"></div>
			<div class="pr"></div>
			<div class="pc1">
			    <form action="" method="get" id="search_form" name="search_form">
				<input name="dpt" id="dpt" type="hidden" value="{*$cf_dpt*}" />
				<div class="pt">
				    标题:
				   <input type="text" size="20" id="skey" name="skey" class="tet" value="{*$skey*}" />
				   &nbsp;&nbsp;创建时间:
					<input name="skey2" class="Wdate" type="text" id="act_start" value="{*$skey2*}" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'act_end\')}',dateFmt:'yyyy-MM-dd',isShowClear:true,readOnly:true});" size="12" maxlength="30" />
					到<input name="skey3" class="Wdate" type="text" id="act_end" value="{*$skey3*}" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'act_start\')}',dateFmt:'yyyy-MM-dd',isShowClear:true,readOnly:true});" size="12" maxlength="30" />
					 &nbsp;				   
				   <input type="image" src="public/images/admin/icon_search_btn.gif" />
				</div>
			    </form>
			</div>
		    </div>
		    <div class="content_panel_title">
			<div class="contentpanelleft"></div>
			<div class="contentpanelcenter">
			    <span class="contentpanelcenter_font">品牌管理</span>
			    <span><a class="edit at" href="{*$cf_self_path*}-act_add.htm?dpt={*$cf_dpt*}">添加品牌</a></span>&nbsp;
			</div>
			<div class="contentpanelrihgt"></div>
		    </div>
		    <div class="content_table_center_style">
			<div class="p8">
			    
		      <form name="list_form" id="list_form" method="post" action="{*$cf_self_page*}">
				<input name="act" type="hidden" value="all" />
				<input name="dpt" type="hidden" value="{*$cf_dpt*}" />
				<table width="100%" class="tbl tbl_nbr">
				    <thead>
					<tr class="thd">
					  <td width="3%" align="center" class="thr">序号</td>
					    <td width="2%" height="28" align="center" class="thr">ID</td>
					    <td width="9%" align="center" class="thr">品牌标题</td>
					    <td width="11%" align="center" class="thr">LOGO图</td>
					    <td width="7%" align="center" class="thr">封面图</td>
					    <td width="9%" align="center" class="thr">发货地址</td>
					    <td width="9%" align="center" class="thr">分类</td>
					    <td width="8%" align="center" class="thr">是否显示</td>
					    <td width="5%" align="center" class="thr">作者</td>
					    <td width="7%" align="center" class="thr">访问总数</td>
				      <td width="17%" align="center" class="thr">创建时间</td>
					    <td colspan="2" align="center" class="thr">操作</td>
					</tr>
				    </thead>
				    <tbody>
					{*foreach $data_ary as $item*}
					<tr onmouseout="this.style.backgroundColor='#ffF'" onmouseover="this.style.backgroundColor='#ffC'">
					  <td align="center">{*$item['brand_sort_num']*}</td>
					    <td align="center">{*$item['brand_id']*}</td>
					    <td align="center"><a href="{*$cf_self_path*}-act_detail_id_{*$item['brand_id']*}.htm?dpt={*$cf_dpt*}" title="查看詳情" class="edit" target="_blank" >{*$item['brand_name']*}</a></td>
					    <td align="center"><a href="{*$item['brand_logo']*}" target="_blank"><img width="50" height="40" src="{*$item['brand_logo']*}" /></a></td>
					    <td align="center"><a href="{*$item['brand_image_path']*}" target="_blank"><img width="50" height="40" src="{*$item['brand_image_path']*}" /></a></td>
					    <td align="center">{*$item['brand_address']*}</td>
					    <td align="center">{*$brand_cate[$item['brand_cate_id']]*}</td>
					    <td align="center">{*$cf_info_var_common['yesno'][$item['brand_is_show']]*}</td>
					    <td align="center">{*$item['brand_author']*}</td>
					    <td align="center">{*$item['brand_total_visits']*}</td>
					    <td align="center">{*$item['brand_create_time']*}</td>
					    <td width="3%" align="center"><a href="{*$cf_self_path*}-act_edit_id_{*$item['brand_id']*}.htm?dpt={*$cf_dpt*}" class="edit">修改</a></td>
					    <td width="10%" align="center"><a href="{*$cf_self_path*}-act_del_id_{*$item['brand_id']*}.htm?dpt={*$cf_dpt*}" class="del" onclick="return confirm('你确定要删除吗?')">删除</a></td>
                      </tr>
					{*/foreach*}
					<tr class="tft">
					    <td colspan="13" style="padding:0;">
						<table width="100%" border="0">
						    <tr>
							<td align="center" style="border:0;padding:0;"><div class="turnPage"><p>{*$page*}</p></div></td>
							</tr>
						</table>                                </td>
					</tr>
				    </tbody>
				</table>
			    </form>
			</div>
		    </div>
		    <div class="content_main_bottom">
			<div class="content_main_bottom_left"></div>
			<div class="content_main_bottom_right"></div>
		    </div>

		    {*/if*}
		</div>        </td>
    </tr>
</table>
{*include file="template/admin_foot.htm"*}